#include "../m_incl/epub_password.h"

constexpr static char TestPath[]        = "wocao.se";
constexpr static char TestPasswordOld[] = "senjyuren@icloud.com";
constexpr static char TestPasswordNew[] = "1234567890";

int main() {
  Pwd_Init(TestPath);

  for (int i = 0; i < 10000; ++i) {
    if (!Pwd_PasswordInit(i, TestPasswordOld))
      return -1;
    if (Pwd_PasswordInit(i, TestPasswordOld))
      return -2;
    if (!Pwd_PasswordVerify(i, TestPasswordOld))
      return -3;
    if (Pwd_PasswordVerify(i, TestPasswordNew))
      return -4;
    if (Pwd_PasswordChange(i, TestPasswordNew, TestPasswordOld))
      return -5;
    if (!Pwd_PasswordChange(i, TestPasswordOld, TestPasswordNew))
      return -6;
    if (Pwd_PasswordVerify(i, TestPasswordOld))
      return -7;
    if (!Pwd_PasswordVerify(i, TestPasswordNew))
      return -8;
  }

  Pwd_Release();
  return 0;
}